#ifdef _WIN32
#include "stdafx.h"
#endif

struct Bar
{
    float current, height, width, period, inverse; // 0 to 1

    ColourValue border, empty, filled;
	Gorilla::Rectangle * frame, * progress;


    Bar()
    {
        current = 0.f;
        border = ColourValue();
        empty = ColourValue(0.5f, 0.5f, 0.5f, 0.2f);
        filled = ColourValue(0.7f, 0.7f, 0.7f, 1.0f);
    }
    
    void set_progress(float f)
    {
        if(f >= 0.0 && f <= 1.0f)
            progress->width(frame->width() * f);

    }
    //void add_progress(float f)
    //{
    //    current += f;
    //    progress -> width (frame->width() * current);
    //    if(current > 1.f) 
    //        current -= 1.f;
    //}
    void add_time(float f)
    {
        current += f;
        if(current > period) 
            current -= period;
        progress->width(width * current * inverse);
    }

};
